package com.myspring.integration.schedule.quartz.type1;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.SchedulerException;
import org.springframework.scheduling.quartz.QuartzJobBean;

public class SpringJob extends QuartzJobBean
{

	@Override
	protected void executeInternal(JobExecutionContext context)
			throws JobExecutionException
	{
		try {
			String key = context.getJobDetail().getKey().getName();
			String group = context.getJobDetail().getKey().getGroup();
			System.out.println("group is : " + group);
			System.out.println("job key is : " + key);
			context.getScheduler().deleteJob(context.getJobDetail().getKey());
		} catch (SchedulerException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		System.out.println("this is spring job");
	}

}
